home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tch_tpas.zip / PROG6.PAS < prev    next >
Pascal/Delphi Source File  |  1986-04-05  |  896b  |  33 lines

  1. PROGRAM PROG6;
  2. {$U+          Copyright (C), 1985 by Lyle Faurot.  All rights reserved.
  3.  
  4.     New Topics: IF statement
  5.                 Conditions used with IF
  6. }
  7.  
  8. VAR
  9.   Have, Want  : Integer;
  10.  
  11. BEGIN
  12.   Write('How many computers do you own? ');
  13.   ReadLn(Have);
  14.   Write('How many computers would you like? ');
  15.   ReadLn(Want);
  16.   WriteLn;
  17.  
  18.   If Have = 0         {One-way IF .. THEN }
  19.     THEN
  20.       WriteLn('No computer!  Give me a call at 123-4567.');
  21.  
  22.   If Have >= Want     {Two-way IF .. THEN .. ELSE }
  23.     THEN
  24.       WriteLn('Congratulations! Happy Computing!')
  25.     ELSE
  26.       WriteLn('Sorry about that!');
  27.  
  28.   If (Want - Have) > 2   {Integer expression as part of condition }
  29.     THEN
  30.       WriteLn('(Aren''t you a little greedy?)');
  31.  
  32. END.
  33.